package com.example.xm.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.xm.entity.Daan;
import com.example.xm.entity.Jindu;
import com.example.xm.service.IDaanService;
import com.example.xm.service.JinduService;
import com.example.xm.web.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2025-02-14
 */
@RestController
@RequestMapping("/system/jindu")
public class JinduController
{
   @Autowired
    private JinduService jinduService;
   @GetMapping("/list")
    public Result list(Jindu jindu){
       QueryWrapper<Jindu> jinduQueryWrapper = new QueryWrapper<>();
       jinduQueryWrapper.eq("vid", jindu.getVid()).eq("uid",jindu.getUid());
       List<Jindu> list = jinduService.list(jinduQueryWrapper);
       return Result.success(list);
   }
   @PostMapping("/add")
    public Result add(@RequestBody  Jindu jindu){
       jinduService.save(jindu);
       return Result.success(jindu);
   }
    @PostMapping("/edit")
    public Result edit(@RequestBody  Jindu jindu){
       jinduService.updateById(jindu);
        return Result.success();
    }
}
